// [2114]句子中的最多单词数
struct Solution;

//leetcode submit region begin(Prohibit modification and deletion)
impl Solution {
    pub fn most_words_found(sentences: Vec<String>) -> i32 {
        sentences.iter().map(|x| {
            x.split(" ").count() as i32
        }).max().unwrap()
    }
}
//leetcode submit region end(Prohibit modification and deletion)


#[test]
fn main() {
    let sentences = vec![
        "alice and bob love leetcode".to_string(), "i think so too".to_string(), "this is great thanks very much".to_string()
    ];
    assert_eq!(Solution::most_words_found(sentences), 6);

    let sentences = vec![
        "please wait".to_string(), "continue to fight".to_string(), "continue to win".to_string()
    ];
    assert_eq!(Solution::most_words_found(sentences), 3);
}